var e = require;
var t = module;
var n = exports;
var o,
    i =
        (this && this.__extends) ||
        ((o = function (e, t) {
            return (o =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                })(e, t);
        }),
        function (e, t) {
            function n() {
                this.constructor = e;
            }
            o(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
        }),
    r =
        (this && this.__decorate) ||
        function (e, t, n, o) {
            var i,
                r = arguments.length,
                a = r < 3 ? t : null === o ? (o = Object.getOwnPropertyDescriptor(t, n)) : o;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(e, t, n, o);
            else
                for (var s = e.length - 1; 0 <= s; s--)
                    (i = e[s]) && (a = (r < 3 ? i(a) : 3 < r ? i(t, n, a) : i(t, n)) || a);
            return 3 < r && a && Object.defineProperty(t, n, a), a;
        };
Object.defineProperty(n, "__esModule", {value: !0});
var a,
    s = e("index"),
    c = e("events"),
    l = e("sound"),
    u = e("vibrate"),
    p = e("player-info"),
    h = e("player-theme"),
    t = cc._decorator,
    e = t.ccclass,
    t = t.property,
    e =
        ((a = cc.Component),
        i(d, a),
        (d.prototype.start = function () {
            this.setBtnInteractable(!1), c.operEvent.on(this.onOperTap.bind(this)), (this.btn.clickSoundEffect = !1);
        }),
        (d.prototype.onOperTap = function (e) {
            null != e &&
                null != e.action &&
                (c.default.shuffleBtn == e.action && null != e.data
                    ? this.setBtnInteractable(e.data.isCan)
                    : c.default.shuffleBtn2 == e.action && null != e.data && this.setBtnInteractable2(e.data.isCan));
        }),
        (d.prototype.setBtnInteractable2 = function (e) {
            this.btn.interactable &&
                ((this.btn.interactable = e),
                (this.btn.node.opacity = e ? 255 : 128),
                e && l.sound.play(l.Sound.RESET));
        }),
        (d.prototype.setBtnInteractable = function (e) {
			
            (this.btn.interactable = e), (this.btn.node.opacity = e ? 255 : 0), e && l.sound.play(l.Sound.RESET);
        }),
        (d.prototype.onShuffle = function () {}),
        (d.prototype.onShuffleCallBack = function () {
            console.log("Shuffle btn"),
                (this.btn.interactable = !1),
                "coin" === h.playerTheme.getCurThemeName()
                    ? l.sound.play(l.Sound.RESETSTART)
                    : l.sound.play(l.Sound.MJ_RESETSTART),
                s.platform.trackEvent("getReset", {bool: !0}),
                u.vibrate.play(u.VibrateNewType.SHORT),
                c.operEvent.emit({action: c.default.shuffle, data: null}),
                this.setBtnInteractable(!1);
            var e = p.playerInfo.getUseResetCount();
            p.playerInfo.setUseResetCount(e + 1);
        }),
        r([t(cc.Button)], d.prototype, "btn", void 0),
			
        r([e], d));
function d() {
    var e = (null !== a && a.apply(this, arguments)) || this;
	return (e.btn = null),e;
}
n.default = e;
